'''

'''
a = [2, 4, 9, 5, 9, 8, 1]
print(max(a))
f = [index for index, value in enumerate(a) if value == max(a)]
print(f)
add = (lambda x, y: x + y)


def func(a=1, **kwargs):
    if len(kwargs) > 0:
        for value in kwargs.values():
            a += value
        print('a', a)


func(n1=3, n2=4)


def func(a=2, b=4):
    sum = b
    for i in range(2):
        sum += i
    print('sum=', sum)


func()

res = map(lambda x: x ** 2, [1, 2, 3, 4])
print(list(res))

a = [1, 2, ['a', 'b']]
b = a
a.insert(0, 3)
a[-1].append(3)
print(b)

s = 'helloworld'
print(s[:5:2])

a = [2, 5, 3, 9, 6]
a, b, *c = sorted(a, reverse=True)
print(a, b, c)
list0 = ['nice', '你好', '今天天气真好', 'beautiful', 'family', [27, 19, 33]]
new_list = [s for s in list0 if type(s) == str]
print(new_list)


def A(func):
    print('-->1')

    def wrapper(*args, **kwargs):
        func()
        print('-->hello')

    return wrapper


@A
def show():
    print('-->python')


def func1(*args, **kwargs):
    print(args, kwargs)


func1(1, 2, a=1, b=2)
list1 = [1, 3, 5, 6, 7, 9, 0, 2, 4, 7, 9]
length = len(list1)
for i in range(length - 1):
    for j in range(i + 1, length):
        if list1[i] > list1[j]:
            list1[i], list1[j] = list1[j], list1[i]
print(list1)
import random

count = 0
list2 = []
while 1:
    a = random.randint(1, 20)
    list2.append(a)
    count += 1
    if count == 5:
        break
print(list2)
print(len(list2))

a = b = c = 10
print(c)
int32 = 0

for i in range(1, 7):
    for j in range(1, i + 1):
        print('{}*{}={}'.format(j, i, i * j), end=' ')
    print()
print(isinstance(2, int))

import sys

print(sys.version)


class Person:
    def __init__(self, name):
        print('我是初始化方法')
        self.name = name

    def __str__(self):
        return self.name


p = Person('tom')
print(p)

print()


class Rect:
    def __init__(self, width, height):
        self.width = width
        self.height = height

    def area(self):
        return self.width * self.height

    def perimeter(self):
        return (self.width + self.height) * 2


class Time:
    def __init__(self, h, m, s):
        self.h = h
        self.m = m
        self.s = s

    def add_hour(self, num):
        return self.h + num

    def add_minute(self, num):
        return self.m + num

    def add_second(self, num):
        return self.s + num

    def show(self):
        h = str(self.h).zfill(2)
        m = str(self.m).zfill(2)
        s = str(self.s).zfill(2)
        print('{}:{}:{}'.format(h, m, s))
